package com.neusoft.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.po.CommonResult;
import com.neusoft.po.User;
import com.neusoft.service.VerificationService;

@RestController
@RequestMapping("/VerificationController")
@RefreshScope //开启动态刷新
public class VerificationController {
	@Autowired
	private VerificationService VerificationService;
	
	@PostMapping("/sendVerificationCodeById/{userId}")
	public CommonResult<Integer> sendVerificationCodeById(@PathVariable String userId) throws Exception {
		return new CommonResult(200,"success",VerificationService.sendVerificationCodeById(userId));
	}
	@GetMapping("/judgeVerificationCodeById/{userId}/{code}")
	public CommonResult<Integer> judgeVerificationCodeById(@PathVariable String userId,@PathVariable String code){
		return new CommonResult(200,"success",VerificationService.judgeVerificationCodeById(userId,code));
	}
}
